package eseo.servlet;
import java.io.IOException;
import java.util.Date;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import eseo.projet.be.Camion;
import eseo.projet.be.GestionCompagnie;
/**
* Servlet implementation class Validation
*/
@WebServlet("/Validation")
public class Validation extends HttpServlet {
	private static final long serialVersionUID = 1L;
	/**
	 * @see HttpServlet#HttpServlet()
	 */
	public Validation() {
		super();
		// TODO Auto-generated constructor stub
	}
	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
	}
	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		HttpSession session = request.getSession();
		//int codeCamion=Integer.parseInt(request.getParameter("codeCamion"));
		//int prixCamion=Integer.parseInt(request.getParameter("prixCamion"));
		int codeReservation;
		codeReservation=GestionCompagnie.recuperationCodeReservation();
		int codeCamion=((Integer)session.getAttribute("codeCamion")).intValue();
		int jour=((Integer)session.getAttribute("jour")).intValue();
		int mois=((Integer)session.getAttribute("mois")).intValue();
		int annee=((Integer)session.getAttribute("annee")).intValue();
		int codeClient=((Integer)session.getAttribute("codeClient")).intValue();
		//int codeReservation=Integer.parseInt(request.getParameter("codeReservation"));
		//boolean infoPaiement=Boolean.parseBoolean(request.getParameter("infoPaiement"));
		eseo.projet.be.Reservation uneReservation = new eseo.projet.be.Reservation(codeReservation, codeCamion, codeClient, new Date(annee-1900, mois-1, jour), false);
	}
}